package com.zhiyou.springcloud.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class days {
	public static int caculateTotalTime(String startTime,String endTime) throws ParseException{
		SimpleDateFormat formatter =   new SimpleDateFormat( "yyyy-MM-dd" );
		Date date1=null;
		Date date = formatter.parse(startTime);
	    long ts = date.getTime();
		date1 =  formatter.parse(endTime);
		long ts1 = date1.getTime();
		long ts2=ts1-ts;
		int totalTime = 0;
		totalTime=(int) (ts2/(24*3600*1000)+1);		
		return totalTime;	
	}

}
